/*
3.Median of Two Sorted Arrays
There are two sorted arrays A and B of size m and n respectively.
Find the median of the two sorted arrays. 
The overall run time complexity should be O(log (m+n)).
*/

#include <iostream>
#include <string>
#include <vector>
#include <unordered_map>
#include <map>
using namespace std;

class Solution {
public:
    double findMedianSortedArrays(int A[], int m, int B[], int n) {
		int total = m + n;
		if(total & 0x1 )
		{
			return findKth(A, m, B, n, total/2 + 1);
		}
		else
		{
			return ( findKth(A, m, B, n, total/2) +
				findKth(A, m, B, n, total/2 + 1)) / 2.0;
		
		}
    }
private:
	static int findKth(int A[], int m, int B[], int n, int k)
	{
		
	}

};  

int main()
{
	int a1 = { 0, 1, 2, 3, 4, 5, 6};
	int a2 = { 2, 4, 6, 8};

	Solution sol1;
	
	int maxLength = sol1.lengthOfLongestSubstring(str1);

	cout<<"The longest substring: "<< maxLength<<endl;
	system("pause");
	return 0;
}